package com.sky.mapper;

import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.entity.Dish;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClassificationMapper {

    List<Category> selectAllCategory(CategoryPageQueryDTO categoryPageQueryDTO);

    void insertCategory(Category category);

    @Delete("delete from category where id = #{id}")
    void deleteCategory(Long id);

    void updateCategory(Category category);

    @Update("update category set status=#{status} where id=#{id}")
    void updateStatusById(Integer status, Long id);

    @Select("select * from category where type=#{type}")
    List<Category> selectCategoryByType(Integer type);

    @Select("select type from category where id=#{id}")
    Integer selectById(Long id);
}